﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using MyVoteMVC.Common.Extensions;

namespace MyVoteMVC.Common.Specifications
{
    internal class NotSpecification<TEntity> : ISpecification<TEntity> where TEntity : class
    {
        private ISpecification<TEntity> Spec;

        internal NotSpecification(ISpecification<TEntity> x)
        {
            Spec = x;
        }

        public Expression<Func<TEntity, bool>> IsSatisfiedBy()
        {
            return Spec.IsSatisfiedBy().Not();
        }
    }

}
